<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp"%>
<head>
<title><spring:message code="admin.viewacl.title" /></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" href="<c:url value="/css/styles.css"/>" />
<script src="<c:url value="/javascripts/common.js"/>"></script>
<script language="javascript">
// script added by Umme Essa. The form should be validated on all operations.
	 var functionName="";
	 function validateForm(){
		if(isAnyCheckBoxSelected("selecter"))return true;
			else {
				alert("Please select a record to remove");
				return false;
			}
	
	 }

 
	 function isAnyCheckBoxSelected(selecter){
		 var items = document.forms[0].elements[selecter];
		 var length=getLength(items);
		 var item=null;
		 	for(i=0;i<length;i++)
		 	{	item=getItemAt(items,i);
		 		if(item.checked)
		 			return true;
		 	}
		 return false;
		 }

		
		 
	 </script>
</head>

<body><%@include file="../top_menu.jsp"%>

<table width=100%>
	<tr>
		<td><c:import url="/WEB-INF/jsp/menu/admin_acl_class_menu.jsp" />
		<br />
		</td>
	</tr>
	<tr>
		<td><%@include file="/WEB-INF/jsp/include/messages.jsp"%>
		<br />
		</td>
	</tr>
</table>
<form action="delete_acl_classes.htm" method="post"
	onsubmit="return validateForm()">
	
<input type="hidden" id="page" name="page" value="${aclClassList.pageNumber}" />	
<input type="hidden" id="page" name="page" value="1" />	
<table width=70% class="formTable" cellspacing="0">
	<tr class="ui-state-default">
		<c:if test="${aclClassList.pageNumber>1}">
			<td align="left" ><a
				href="view_acl_classes.htm?pageNo=${aclClassList.pageNumber-1}&sortColumn=${aclClassList.sortColumn}"
				class="mouseEffect"><span class="ui-icon ui-icon-seek-prev"
				style="float: left;"></span><spring:message code="admin.viewacl.button.previouspage" /></a></td>
		</c:if>
		<c:if test="${aclClassList.pageNumber<aclClassList.pagesAvailable}">
			<td  align="right"><a
				href="view_acl_classes.htm?pageNo=${aclClassList.pageNumber+1}&sortColumn=${aclClassList.sortColumn}"
				class="mouseEffect"><span class="ui-icon ui-icon-seek-next"
				style="float: right;"></span><spring:message code="admin.viewacl.button.nextpage" /></a></td>
		</c:if>
	</tr>
</table>
<table width=70% class="formTable">
	<tr class="formHeader">
		<td colspan="5"><spring:message code="admin.viewacl.title" /></td>
	</tr>
	<tr>
		<td align="center"><input type="checkbox"
			onclick="ch_select(this.checked)" /></td>
		<th>#</th>
		<th><a	href="view_acl_classes.htm?pageNo=${aclClassList.pageNumber}&sortColumn=name&sortOrder=${aclClassList.sortOrder}"
				class="headerLink" style="cursor: pointer;" title="${aclClassList.sortOrder}"><spring:message code="admin.viewacl.label.name" /></a></th>
		<th><a	href="view_acl_classes.htm?pageNo=${aclClassList.pageNumber}&sortColumn=class&sortOrder=${aclClassList.sortOrder}"
				class="headerLink" style="cursor: pointer;" title="${aclClassList.sortOrder}" ><spring:message code="admin.viewacl.label.classname" /></a></th>
	</tr>

	<tbody>
		<c:if test="${empty aclClassList}">
			<tr>
				<td colspan="4"><spring:message code="admin.viewacl.label.noaclclassesfound" /></td>
			</tr>
		</c:if>

		<c:forEach var="r" items="${aclClassList.pageItems}" varStatus="i">
			<tr class="tr_record">
				<td align="center"><input id="selecter" type="checkbox"
					class="AclClass" name="ids" value="${r.id}"></input></td>
				<td>${i.count+
				(aclClassList.recordSize*(aclClassList.pageNumber-1))}</td>
				<td><a
					href="<c:url value="/admin/acl/edit_acl_class.htm?id=${r.id}"/>">${r.name}</a></td>
				<td>${r.className}</td>
			</tr>
		</c:forEach>
		<tr>
			<td colspan="4"><input type="submit"
				class='ui-button ui-state-default ui-corner-all' value="<spring:message code="admin.viewacl.button.remove" />" /></td>
		</tr>
	</tbody>
</table>
<table width=70% class="formTable" cellspacing="0">
	<tr class="ui-state-default">
		<c:if test="${aclClassList.pageNumber>1}">
			<td align="left" ><a
				href="view_acl_classes.htm?pageNo=${aclClassList.pageNumber-1}&sortColumn=${aclClassList.sortColumn}"
				class="mouseEffect"><span class="ui-icon ui-icon-seek-prev"
				style="float: left;"></span><spring:message code="admin.viewacl.button.previouspage" /></a></td>
		</c:if>
		<c:if test="${aclClassList.pageNumber<aclClassList.pagesAvailable}">
			<td  align="right"><a
				href="view_acl_classes.htm?pageNo=${aclClassList.pageNumber+1}&sortColumn=${aclClassList.sortColumn}"
				class="mouseEffect"><span class="ui-icon ui-icon-seek-next"
				style="float: right;"></span><spring:message code="admin.viewacl.button.nextpage" /></a></td>
		</c:if>
	</tr>
</table>
</form>
<%@include file="/WEB-INF/jsp/include/footer.jsp"%>
</body>
</html>